package com.itheima.d13_api_object;

import java.util.Arrays;

public class Test2 {
    public static void main(String[] args) throws CloneNotSupportedException {

        // 目标: 掌握Object类提供的对象克隆方法
        // 1.  protected Object clone() : 克隆对象
        User u1 = new User(1, "张三", "123456", new double[]{1, 2, 3, 4});
        User u2 = (User) u1.clone();

        System.out.println(u1 == u2);
        System.out.println(u2.getId());
        System.out.println(u2.getPassword());
        System.out.println(Arrays.toString(u2.getScores()));
        System.out.println(u2.getUserName());
    }
}
